void __attribute__((naked,noinline)) sub_FFC61ED8_my(){
asm volatile(
                "LDR     R12, =0x201E\n"
                "STMFD   SP!, {R4,LR}\n"
                "CMP     R0, R12\n"
                "BEQ     loc_FFC61F98\n"
                "BGT     loc_FFC61F34\n"
                "LDR     R12, =0x2004\n"
                "CMP     R0, R12\n"
                "BEQ     loc_FFC61FA0\n"
                "BGT     loc_FFC61F1C\n"
                "SUB     R12, R0, #0x1000\n"
                "SUBS    R12, R12, #0xA9\n"
                "SUBNE   R12, R0, #0x1000\n"
                "SUBNES  R12, R12, #0xAD\n"
                "SUBNE   R12, R0, #0x1000\n"
                "SUBNES  R12, R12, #0xAF\n"
                "BNE     loc_FFC61FB0\n"
                "B       loc_FFC61F98\n"
"loc_FFC61F1C:\n"
                "SUB     R12, R0, #0x2000\n"
                "SUBS    R12, R12, #5\n"
                "SUBNE   R12, R0, #0x2000\n"
                "SUBNES  R12, R12, #0x1D\n"
                "BNE     loc_FFC61FB0\n"
                "B       loc_FFC61F98\n"
"loc_FFC61F34:\n"
                "LDR     R12, =0x5004\n"
                "CMP     R0, R12\n"
                "BEQ     loc_FFC61F98\n"
                "BGT     loc_FFC61F60\n"
                "SUB     R12, R0, #0x3000\n"
                "SUBS    R12, R12, #0xA\n"
                "BEQ     loc_FFC61F94\n"
                "SUB     R12, R0, #0x5000\n"
                "SUBS    R12, R12, #1\n"
                "BNE     loc_FFC61FB0\n"
                "B       loc_FFC61F98\n"
"loc_FFC61F60:\n"
                "SUB     R12, R0, #0x5000\n"
                "SUBS    R12, R12, #6\n"
                "BEQ     loc_FFC61F98\n"
                "SUB     R12, R0, #0x5000\n"
                "SUBS    R12, R12, #7\n"
                "BNE     loc_FFC61FB0\n"
                "BL      sub_FFC1CF54\n"
                "LDR     R1, =0x5DE4\n"
                "LDR     R0, [R1,#0x10]\n"
                "CMP     R0, #7\n"
                "LDREQ   R0, [R1,#0x18]\n"
                "BLEQ    sub_FFC628E0\n"
                "B       loc_FFC61FA8\n"
"loc_FFC61F94:\n"
                "BL      sub_FFC1C398\n"
"loc_FFC61F98:\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFC61D88_my\n"   //------------->
"loc_FFC61FA0:\n"
                "BL      sub_FFC60C40\n"
                "BL      sub_FFC61740\n"
"loc_FFC61FA8:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R4,PC}\n"
"loc_FFC61FB0:\n"
                "MOV     R0, #1\n"
                "LDMFD   SP!, {R4,PC}\n"
 );
}


void __attribute__((naked,noinline)) sub_FFC61D88_my(){
asm volatile(
                "STMFD   SP!, {R4-R6,LR}\n"
                "BL      sub_FFC62A08\n"
                "CMP     R0, #1\n"
                "BLEQ    sub_FFC62AE8\n"
                "LDR     R4, =0x5DE4\n"
                "MOV     R5, #1\n"
                "LDR     R0, [R4,#0x24]\n"
                "CMP     R0, #0\n"
                "LDRNE   R0, [R4,#0x4C]\n"
                "CMPNE   R0, #0\n"
                "BEQ     loc_FFC61DF4\n"
                "BL      sub_FFC62A08\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC61DF4\n"
                "BL      sub_FFC62AE8\n"
                "LDR     R0, [R4,#0x78]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC61DF4\n"
                "LDR     R1, =0xFFC61FB8\n"
                "MOV     R0, #0x20\n"
                "BL      sub_FFC59F58\n"
                "BL      sub_FFD7A048\n"
                "BL      sub_FFD79FD4\n"
                "MOV     R1, #0\n"
                "MOV     R0, #0x51\n"
                "BL      sub_FFC6A80C\n"
                "STR     R5, [R4,#0x78]\n"
"loc_FFC61DF4:\n"
                "BL      sub_FFC62A08\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC61E40\n"
                "LDR     R0, [R4,#0x44]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC61E40\n"
                "LDR     R0, [R4,#0x74]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC61E40\n"
                "LDR     R1, =0xFFC61FCC\n"
                "MOV     R0, #0x20\n"
                "BL      sub_FFC59F58\n"
                "MOV     R1, #0\n"
                "MOV     R0, #0x8C\n"
                "BL      sub_FFC6A80C\n"
                "BL      sub_FFC68AC0\n"
                "MOV     R0, #0x21\n"
                "BL      sub_FFC6A84C\n"
                "STR     R5, [R4,#0x74]\n"
"loc_FFC61E40:\n"
                "LDR     R0, [R4,#0x38]\n"
                "CMP     R0, #0\n"
                "LDRNE   R0, [R4,#0x3C]\n"
                "CMPNE   R0, #0\n"
                "LDRNE   R0, [R4,#0x44]\n"
                "CMPNE   R0, #0\n"
                "LDRNE   R0, [R4,#0x48]\n"
                "CMPNE   R0, #0\n"
                "LDRNE   R0, [R4,#0x1C]\n"
                "LDRNE   R1, [R4,#0x20]\n"
                "ORRNES  R0, R0, R1\n"
                "BEQ     loc_FFC61E7C\n"
                "BL      sub_FFC61550\n"
                "BL      sub_FFC61740\n"
                "B       loc_FFC61EA0\n"
"loc_FFC61E7C:\n"
                "LDR     R0, [R4,#0x58]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC61EA8\n"
                "BL      sub_FFC615EC\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC61EA8\n"
                "BL      sub_FFC644D4\n"
                "BL      sub_FFC642F4\n"
                "BL      sub_FFC6291C\n"
"loc_FFC61EA0:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R4-R6,PC}\n"
"loc_FFC61EA8:\n"
                "BL      sub_FFC615EC\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC61ED0\n"
                "LDR     R0, [R4,#0x7C]\n"
                "CMP     R0, #0\n"
                "BLEQ    sub_FFC62B2C_my\n"  //-------------->
                "MOV     R0, #0\n"
                "STR     R0, [R4,#0x70]\n"
                "STR     R0, [R4,#0x74]\n"
                "STR     R0, [R4,#0x78]\n"
"loc_FFC61ED0:\n"
                "MOV     R0, #1\n"
                "LDMFD   SP!, {R4-R6,PC}\n"
);
}






void __attribute__((naked,noinline)) sub_FFC62B2C_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, =0xFFC62D68\n"
                "MOV     R0, #0x20\n"
                "BL      sub_FFC59F58\n"
                "BL      sub_FFC1C5BC\n"
                "BL      sub_FFC63004\n"
                "BL      sub_FFC66370_my\n"   //------------->
                "MOV     R0, #1\n"
                "BL      sub_FFC60FE8\n"
                "BL      sub_FFC614D4\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFC617A0\n"
 );
} 





void __attribute__((naked,noinline)) sub_FFC66370_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R6,LR}\n"
                "LDR     R1, =0xFFC66564\n"
                "MOV     R0, #0x20\n"
                "BL      sub_FFC59F58\n"
                "LDR     R4, =0x607C\n"
                "MOV     R0, #6\n"
                "MOV     R5, #1\n"
                "STR     R0, [R4,#0x60]\n"
                "STR     R5, [R4,#0x10]\n"
                "BL      sub_FFD281E0\n"
                "BL      sub_FFD3C1C0\n"
                "BL      sub_FFD2F34C\n"
                "BL      sub_FFD2D088\n"
                "BL      sub_FFC66994_my\n"  //---------------->
                "BL      sub_FFD3CB88\n"
                "BL      sub_FFD394AC\n"
                "BL      sub_FFD3C068\n"
                "MOV     R0, #1\n"
                "STR     R5, [R4,#0x1C]\n"
                "BL      sub_FFC66A7C\n"
                "MOV     R0, #3\n"
                "STR     R0, [R4,#0x6C]\n"
                "LDR     R1, [R4,#0x70]\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "MOV     R0, #0\n"
                "BX      R1\n"
 );
} 





void __attribute__((naked,noinline)) sub_FFC66994_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R0, =0x855\n"
                "BL      sub_FFC5EDAC\n"
                "BL      sub_FFC1C398\n"
                "BL      sub_FFC6613C_my\n"  //------------>
                "BL      sub_FFD27AC8\n"
                "BL      sub_FFD22EE8\n"
                "BL      sub_FFD313D4\n"
                "BL      sub_FFD31A64\n"
                "BL      sub_FFD39084\n"
                "BL      sub_FFD31F10\n"
                "BL      sub_FFD3C5D4\n"
                "BL      sub_FFD3BD3C\n"
                "BL      sub_FFD315AC\n"
                "BL      sub_FFD3B774\n"
                "BL      sub_FFD2FC8C\n"
                "BL      sub_FFD38C64\n"
                "BL      sub_FFD38768\n"
                "BL      sub_FFD2DDF4\n"
                "BL      sub_FFD3AD18\n"
                "BL      sub_FFC6A98C\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFC6A71C\n"
 );
} 




void __attribute__((naked,noinline)) sub_FFC6613C_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R0, =0x60F0\n"
                "LDR     R1, =sub_FFC65EBC_my\n"   //-------------->
                "BL      sub_FFC6C25C\n"
                "LDR     R1, =0x607C\n"
                "LDR     R0, =sub_FFC65FF4_my\n"   //--------------->
                "STR     R0, [R1,#0x70]\n"
                "LDMFD   SP!, {R4,PC}\n"
 );
} 



//branch 1

void __attribute__((naked,noinline)) sub_FFC65EBC_my(){ 
 asm volatile(
                "STMFD   SP!, {R3-R5,LR}\n"
                "BL      sub_FFD21CAC\n"
                "LDR     R4, =0x607C\n"
                "LDR     R0, [R4,#0x34]\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC65EF4\n"
                "LDR     R1, =0xFFC65FD4\n"
                "MOV     R0, #0x20\n"
                "BL      sub_FFC59F58\n"
                "MOV     R0, #0\n"
                "STR     R0, [R4,#0x34]\n"
                "STR     R0, [R4,#0x30]\n"
                "BL      sub_FFC65DD4\n"
                "LDMFD   SP!, {R3-R5,PC}\n"
"loc_FFC65EF4:\n"
                "BL      sub_FFC16814\n"
                "LDRH    R0, [R4,#4]\n"
                "SUB     R12, R0, #0x8200\n"
                "SUBS    R12, R12, #0xA\n"
                "BNE     loc_FFC65F18\n"
                "MOV     R0, #0x24\n"
                "BL      sub_FFC6A84C\n"
                "MOV     R0, #0x25\n"
                "BL      sub_FFC6A84C\n"
"loc_FFC65F18:\n"
                "LDRH    R0, [R4,#4]\n"
                "MOV     R1, SP\n"
                "STRH    R0, [SP]\n"
                "LDR     R0, [R4,#0x60]\n"
                "STRH    R0, [SP,#2]\n"
                "MOV     R0, #0x40\n"
                "BL      sub_FFC6A80C\n"
                "LDR     R0, [R4,#0x20]\n"
                "CMP     R0, #0\n"
                "LDREQH  R0, [R4,#4]\n"
                "BLEQ    sub_FFC60158\n"
                "LDRH    R0, [R4,#4]\n"
                "MOV     R1, #1\n"
                "BL      sub_FFC652B0_my\n"    //----------------->
                "LDR     R0, [R4,#0x6C]\n"
                "BL      sub_FFC66A7C\n"
                "MOV     R0, #3\n"
                "STR     R0, [R4,#0x6C]\n"
                "LDR     R1, [R4,#0x70]\n"
                "ADD     SP, SP, #4\n"
                "LDMFD   SP!, {R4,R5,LR}\n"
                "MOV     R0, #0\n"
                "BX      R1\n"
 );
} 




//branch 2

void __attribute__((naked,noinline)) sub_FFC65FF4_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R6,LR}\n"
                "LDR     R5, =0x607C\n"
                "LDRH    R0, [R5,#4]\n"
                "BL      sub_FFD2F584\n"
                "BL      sub_FFD2D2BC\n"
                "BL      sub_FFD31668\n"
                "BL      sub_FFD31FAC\n"
                "BL      sub_FFD39150\n"
             // "BL      nullsub_101\n"
                "BL      sub_FFD2FE28\n"
                "MOV     R4, #0\n"
                "MOV     R0, R4\n"
                "STR     R4, [R5,#0x28]\n"
                "BL      sub_FFC168FC\n"
                "LDR     R0, [R5,#0x14]\n"
                "LDR     R6, =0x313D\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC6606C\n"
                "BL      sub_FFC5CCC0\n"
                "STR     R0, [R5,#0x5C]\n"
                "STR     R4, [R5,#0x1C]\n"
                "STR     R4, [R5,#0x14]\n"
                "STR     R4, [R5,#0x30]\n"
                "MOV     R0, #0xC\n"
                "STR     R4, [R5,#0x24]\n"
                "BL      sub_FFC2D9D0\n"
                "MOV     R0, R6\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "MOV     R1, #0\n"
                "B       sub_FFC5D730\n"
"loc_FFC6606C:\n"
             // "BL      nullsub_108\n"
                "STR     R4, [R5,#0x40]\n"
                "LDRH    R0, [R5,#4]\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC652B0_my\n"    //-------------->
                "BL      sub_FFC68AC0\n"
                "LDR     R0, [R5,#0x64]\n"
                "CMP     R0, #0\n"
                "STRNE   R4, [R5,#0x64]\n"
                "BLNE    sub_FFC665F8\n"
                "BL      sub_FFD2DEC8\n"
                "LDR     R1, [R5,#0x60]\n"
                "MOV     R0, #0x41\n"
                "BL      sub_FFC6A80C\n"
                "BL      sub_FFC665F8\n"
                "BL      sub_FFD2D27C\n"
                "BL      sub_FFD28354\n"
                "CMP     R0, #0\n"
                "BLEQ    sub_FFD2D2C0\n"
                "BL      sub_FFD2F50C\n"
                "BL      sub_FFD21B1C\n"
                "BL      sub_FFC5CCC0\n"
                "STR     R0, [R5,#0x5C]\n"
                "LDR     R0, [R5,#0x14]\n"
                "CMP     R0, #0\n"
                "MOVNE   R0, #0xC\n"
                "STRNE   R4, [R5,#0x14]\n"
                "BLNE    sub_FFC2D9D0\n"
                "LDR     R0, =0x8003\n"
                "STR     R4, [R5,#0x30]\n"
                "BL      sub_FFC602BC\n"
                "STRH    R0, [R5]\n"
                "MOV     R0, R6\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC5D730\n"
                "BL      sub_FFC66910\n"
                "LDR     R0, [R5,#0x34]\n"
                "CMP     R0, #1\n"
                "STREQ   R4, [R5,#0x34]\n"
                "LDMEQFD SP!, {R4-R6,LR}\n"
                "BEQ     sub_FFC65DD4\n"
                "LDMFD   SP!, {R4-R6,PC}\n"
 );
} 




//branches are joining here

void __attribute__((naked,noinline)) sub_FFC652B0_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R6,LR}\n"
                "MOV     R5, R0\n"
                "MOV     R4, R1\n"
                "LDR     R1, =0xFFC654A8\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59F58\n"
                "LDR     R6, =0x607C\n"
                "LDR     R0, [R6,#0x10]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC65468\n"
                "LDR     R0, [R6,#0x1C]\n"
                "LDR     R1, =0x820A\n"
                "LDR     R2, =0xFFFE0000\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC65330\n"
                "CMP     R4, #1\n"
                "LDMEQFD SP!, {R4-R6,PC}\n"
                "CMP     R4, #0\n"
                "BNE     loc_FFC65330\n"
                "CMP     R5, R1\n"
                "BNE     loc_FFC65310\n"
                "BL      sub_FFC66990\n"
                "BL      sub_FFC6663C\n"
                "B       loc_FFC65468\n"
"loc_FFC65310:\n"
                "CMP     R2, R5,LSL#17\n"
                "TSTNE   R5, #0xC00\n"
                "BEQ     loc_FFC65324\n"
                "BL      sub_FFC666E4_my\n"  //-------------->
                "B       loc_FFC65328\n"
"loc_FFC65324:\n"
                "BL      sub_FFC66698\n"
"loc_FFC65328:\n"
                "BL      sub_FFC66990\n"
                "B       loc_FFC65468\n"
"loc_FFC65330:\n"
                "CMP     R5, R1\n"
                "BNE     loc_FFC65384\n"
                "LDRH    R0, [R6,#2]\n"
                "CMP     R0, R1\n"
                "BEQ     loc_FFC65460\n"
                "CMP     R2, R0,LSL#17\n"
                "TSTNE   R0, #0xC00\n"
                "BEQ     loc_FFC65368\n"
                "LDR     R1, =0xFFC654C8\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59F58\n"
                "CMP     R4, #1\n"
                "BEQ     loc_FFC65438\n"
                "B       loc_FFC6537C\n"
"loc_FFC65368:\n"
                "LDR     R1, =0xFFC654D8\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59F58\n"
                "CMP     R4, #1\n"
                "BEQ     loc_FFC65454\n"
"loc_FFC6537C:\n"
                "BL      sub_FFC6663C\n"
                "B       loc_FFC65460\n"
"loc_FFC65384:\n"
                "CMP     R2, R5,LSL#17\n"
                "LDRH    R0, [R6,#2]\n"
                "TSTNE   R5, #0xC00\n"
                "BEQ     loc_FFC653F4\n"
                "CMP     R0, R1\n"
                "BNE     loc_FFC653B4\n"
                "LDR     R1, =0xFFC654E8\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59F58\n"
                "CMP     R4, #1\n"
                "BEQ     loc_FFC65410\n"
                "B       loc_FFC653EC\n"
"loc_FFC653B4:\n"
                "CMP     R2, R0,LSL#17\n"
                "TSTNE   R0, #0xC00\n"
                "BEQ     loc_FFC653D8\n"
                "LDR     R1, =0xFFC654F8\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59F58\n"
                "CMP     R4, #1\n"
                "BEQ     loc_FFC65438\n"
                "B       loc_FFC653EC\n"
"loc_FFC653D8:\n"
                "LDR     R1, =0xFFC65508\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59F58\n"
                "CMP     R4, #1\n"
                "BEQ     loc_FFC65454\n"
"loc_FFC653EC:\n"
                "BL      sub_FFC666E4_my\n"   //--------------->
                "B       loc_FFC65460\n"
"loc_FFC653F4:\n"
                "CMP     R0, R1\n"
                "BNE     loc_FFC65418\n"
                "LDR     R1, =0xFFC65518\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59F58\n"
                "CMP     R4, #1\n"
                "BNE     loc_FFC6545C\n"
"loc_FFC65410:\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "B       sub_FFC6666C\n"
"loc_FFC65418:\n"
                "CMP     R2, R0,LSL#17\n"
                "TSTNE   R0, #0xC00\n"
                "BEQ     loc_FFC65440\n"
                "LDR     R1, =0xFFC65528\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59F58\n"
                "CMP     R4, #1\n"
                "BNE     loc_FFC6545C\n"
"loc_FFC65438:\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "B       sub_FFC66710\n"
"loc_FFC65440:\n"
                "LDR     R1, =0xFFC65538\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59F58\n"
                "CMP     R4, #1\n"
                "BNE     loc_FFC6545C\n"
"loc_FFC65454:\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "B       sub_FFC666C0\n"
"loc_FFC6545C:\n"
                "BL      sub_FFC66698\n"
"loc_FFC65460:\n"
                "CMP     R4, #0\n"
                "LDMNEFD SP!, {R4-R6,PC}\n"
"loc_FFC65468:\n"
                "STRH    R5, [R6,#2]\n"
                "LDMFD   SP!, {R4-R6,PC}\n"
 );
} 





void __attribute__((naked,noinline)) sub_FFC666E4_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, =0xFFC668F4\n"
                "MOV     R0, #0x20\n"
                "BL      sub_FFC59F58\n"
                "LDR     R0, =0x607C\n"
                "LDR     R0, [R0,#0x2C]\n"
                "CMP     R0, #0\n"
                "BLNE    sub_FFC675B4\n"
                "LDMFD   SP!, {R4,LR}\n"
                "MOV     R0, #0\n"
                "B       sub_FFC69AB8_my\n" //------------->
 );
} 




void __attribute__((naked,noinline)) sub_FFC69AB8_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R4, =0x623C\n"
                "MOV     R0, #0\n"
                "STR     R0, [R4,#0x30]\n"
                "LDR     R0, [R4,#8]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC69AE4\n"
                "LDR     R0, =sub_FFC696C4_my\n"    //----------------->
                "MOV     R1, #0\n"
                "BL      sub_FFC5CF34\n"
                "STR     R0, [R4,#8]\n"
"loc_FFC69AE4:\n"
                "LDR     R0, [R4,#0xC]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC69B00\n"
                "LDR     R0, =0xFFC69364\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC6628C\n"
                "STR     R0, [R4,#0xC]\n"
"loc_FFC69B00:\n"
                "BL      sub_FFC6A28C\n"
                "BL      sub_FFC693C8\n"
                "BL      sub_FFD39A64\n"
                "BL      sub_FFD3D3E4\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFD2ECC4\n"
 );
} 




void __attribute__((naked,noinline)) sub_FFC696C4_my(){ 
 asm volatile(
                "STMFD   SP!, {R3-R11,LR}\n"
                "LDR     R5, =0x623C\n"
                "MOV     R4, R1\n"
                "LDR     R2, [R5,#0x2C]\n"
                "ADD     R0, R5, #0\n"
                "LDR     R0, [R0,#0x14]\n"
                "LDR     R9, =0x3007\n"
                "CMP     R2, #0\n"
                "MOV     R1, #0\n"
                "MOV     R11, R3\n"
                "MVN     R8, #0\n"
                "BEQ     loc_FFC6973C\n"
                "CMP     R4, R9\n"
                "BEQ     loc_FFC6992C\n"
                "CMP     R4, #0x800\n"
                "LDREQ   R2, [R5,#0x38]\n"
                "CMPEQ   R11, R2\n"
                "BNE     loc_FFC69A3C\n"
                "STR     R1, [R5,#0x2C]!\n"
                "CMP     R0, #0\n"
                "STR     R8, [R5,#0xC]\n"
                "BNE     loc_FFC69AB0\n"
                "BL      sub_FFC1CE60\n"
                "CMP     R0, #1\n"
                "BEQ     loc_FFC69734\n"
                "BL      sub_FFC1CE68\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC69AB0\n"
"loc_FFC69734:\n"
                "BL      sub_FFC69514\n"
                "B       loc_FFC69AB0\n"
"loc_FFC6973C:\n"
                "CMP     R0, #1\n"
                "SUBEQ   R12, R4, #0x2000\n"
                "SUBEQS  R12, R12, #0x1C\n"
                "BNE     loc_FFC69758\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC69D3C\n"
                "B       loc_FFC69AB0\n"
"loc_FFC69758:\n"
                "BL      sub_FFC75624\n"
                "LDR     R10, =0x9A5\n"
                "CMP     R0, #1\n"
                "SUB     R6, R10, #4\n"
                "SUB     R7, R10, #2\n"
                "BNE     loc_FFC6978C\n"
                "CMP     R4, R10\n"
                "CMPNE   R4, R6\n"
                "CMPNE   R4, R7\n"
                "BNE     loc_FFC6978C\n"
                "BL      sub_FFC747B4\n"
                "STR     R4, [R5,#0x3C]\n"
                "B       loc_FFC69A3C\n"
"loc_FFC6978C:\n"
                "BL      sub_FFD2D098\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC697AC\n"
                "MOV     R0, R4\n"
                "BL      sub_FFC5D470\n"
                "CMP     R0, #1\n"
                "CMPNE   R4, R10\n"
                "BEQ     loc_FFC69A3C\n"
"loc_FFC697AC:\n"
                "BL      sub_FFC1CF88\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC697C4\n"
                "CMP     R4, R6\n"
                "CMPNE   R4, R7\n"
                "BEQ     loc_FFC69AB0\n"
"loc_FFC697C4:\n"
                "BL      sub_FFC66464\n"
                "LDR     R1, =0x9A2\n"
                "CMP     R0, #1\n"
                "ADD     R2, R1, #2\n"
                "BNE     loc_FFC697EC\n"
                "CMP     R4, R6\n"
                "CMPNE   R4, R1\n"
                "CMPNE   R4, R7\n"
                "CMPNE   R4, R2\n"
                "BEQ     loc_FFC69AB0\n"
"loc_FFC697EC:\n"
                "LDR     R12, =0x200A\n"
                "CMP     R4, R12\n"
                "BEQ     loc_FFC69AA0\n"
                "BGT     loc_FFC69868\n"
                "LDR     R12, =0x907\n"
                "CMP     R4, R12\n"
                "MOVEQ   R1, #2\n"
                "MOVEQ   R0, R10\n"
                "BEQ     loc_FFC699DC\n"
                "BGT     loc_FFC69844\n"
                "SUB     R12, R4, #0x800\n"
                "LDR     R6, =0x2003\n"
                "SUBS    R12, R12, #0x26\n"
                "BEQ     loc_FFC69940\n"
                "SUB     R12, R4, #0x800\n"
                "SUBS    R12, R12, #0x29\n"
                "BEQ     loc_FFC69984\n"
                "CMP     R4, #0x860\n"
                "SUBNE   R12, R4, #0x800\n"
                "SUBNES  R12, R12, #0x61\n"
                "BNE     loc_FFC69A54\n"
                "B       loc_FFC69A3C\n"
"loc_FFC69844:\n"
                "CMP     R4, R6\n"
                "BEQ     loc_FFC699D4\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FFC69AA0\n"
                "CMP     R4, R7\n"
                "BEQ     loc_FFC699D4\n"
                "CMP     R4, R2\n"
                "BEQ     loc_FFC69AA0\n"
                "B       loc_FFC69A54\n"
"loc_FFC69868:\n"
                "LDR     R12, =0x3149\n"
                "CMP     R4, R12\n"
                "MOVEQ   R1, #0\n"
                "MOVEQ   R0, #0x84\n"
                "BEQ     loc_FFC69A4C\n"
                "BGT     loc_FFC698C0\n"
                "SUB     R12, R4, #0x2000\n"
                "SUBS    R12, R12, #0x20\n"
                "MOVEQ   R1, R11\n"
                "MOVEQ   R0, #0x83\n"
                "BEQ     loc_FFC69A4C\n"
                "CMP     R4, R9\n"
                "BEQ     loc_FFC69918\n"
                "SUB     R12, R4, #0x3100\n"
                "SUBS    R12, R12, #0x35\n"
                "BEQ     loc_FFC698FC\n"
                "SUB     R12, R4, #0x3000\n"
                "SUBS    R12, R12, #0x148\n"
                "BNE     loc_FFC69A54\n"
                "MOV     R1, #0\n"
                "MOV     R0, #0x86\n"
                "B       loc_FFC69A4C\n"
"loc_FFC698C0:\n"
                "SUB     R12, R4, #0x3100\n"
                "SUBS    R12, R12, #0x4A\n"
                "BEQ     loc_FFC69A44\n"
                "SUB     R12, R4, #0x4000\n"
                "SUBS    R12, R12, #3\n"
                "BEQ     loc_FFC69A00\n"
                "SUB     R12, R4, #0x4000\n"
                "SUBS    R12, R12, #8\n"
                "BEQ     loc_FFC699E4\n"
                "SUB     R12, R4, #0x4000\n"
                "SUBS    R12, R12, #0xF\n"
                "BNE     loc_FFC69A54\n"
                "MOV     R0, #0x82\n"
                "BL      sub_FFC6A84C\n"
                "B       loc_FFC69AB0\n"
"loc_FFC698FC:\n"
                "BL      sub_FFC6A2C0\n"
                "CMP     R0, #4\n"
                "BEQ     loc_FFC69AA0\n"
                "LDR     R0, [R5,#0x1C]\n"
                "CMP     R0, #0\n"
                "BLNE    sub_FFC6945C\n"
                "B       loc_FFC69AB0\n"
"loc_FFC69918:\n"
                "MOV     R0, #1\n"
                "STR     R0, [R5,#0x1C]\n"
                "LDR     R0, [R5,#0x18]\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC69934\n"
"loc_FFC6992C:\n"
                "BL      sub_FFC6945C\n"
                "LDMFD   SP!, {R3-R11,PC}\n"
"loc_FFC69934:\n"
                "MOV     R0, R4\n"
                "BL      sub_FFC69634\n"
                "B       loc_FFC69AB0\n"
"loc_FFC69940:\n"
                "BL      sub_FFC66464\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC69958\n"
                "MOV     R0, R4\n"
                "BL      sub_FFC66458\n"
                "B       loc_FFC69AB0\n"
"loc_FFC69958:\n"
                "LDR     R0, [R5,#0x10]\n"
                "LDR     R1, [R5,#0x14]\n"
                "ORR     R0, R0, R1\n"
                "LDR     R1, [R5,#0x1C]\n"
                "ORRS    R0, R0, R1\n"
                "BNE     loc_FFC69AB0\n"
                "MOV     R1, #0\n"
                "MOV     R0, R6\n"
                "BL      sub_FFC4BB5C\n"
                "BL      sub_FFD60BDC\n"
                "B       loc_FFC69AB0\n"
"loc_FFC69984:\n"
                "LDR     R0, [R5,#0x10]\n"
                "LDR     R1, [R5,#0x14]\n"
                "ORRS    R0, R0, R1\n"
                "BNE     loc_FFC69AB0\n"
                "BL      sub_FFC66470\n"
                "CMP     R0, #0\n"
                "LDREQ   R0, [R5,#0x1C]\n"
                "CMPEQ   R0, #0\n"
                "BNE     loc_FFC69AB0\n"
                "BL      sub_FFC66464\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC69AB0\n"
                "BL      sub_FFD3D48C\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC69AB0\n"
                "MOV     R1, #0\n"
                "MOV     R0, R6\n"
                "BL      sub_FFC4BB5C\n"
                "BL      sub_FFD229E0\n"
                "B       loc_FFC69AB0\n"
"loc_FFC699D4:\n"
                "MOV     R1, #1\n"
                "MOV     R0, R4\n"
"loc_FFC699DC:\n"
                "BL      sub_FFC69570_my\n"   //-------------->
                "LDMFD   SP!, {R3-R11,PC}\n"
"loc_FFC699E4:\n"
                "MOV     R0, R11\n"
                "BL      sub_FFC64D00\n"
                "CMP     R0, #0\n"
                "MOVEQ   R1, R11\n"
                "MOVEQ   R0, R4\n"
                "BLEQ    sub_FFC69F2C_my\n"   //-------------->
                "B       loc_FFC69A3C\n"
"loc_FFC69A00:\n"
                "LDR     R0, [R5,#0x3C]\n"
                "CMN     R0, #1\n"
                "BEQ     loc_FFC69A3C\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC73838\n"
                "LDR     R0, [R5,#0x3C]\n"
                "CMP     R0, R6\n"
                "BNE     loc_FFC69A2C\n"
                "BL      sub_FFC1CE60\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC69A38\n"
"loc_FFC69A2C:\n"
                "LDR     R0, [R5,#0x3C]\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC5D6E4\n"
"loc_FFC69A38:\n"
                "STR     R8, [R5,#0x3C]\n"
"loc_FFC69A3C:\n"
                "MOV     R0, #1\n"
                "LDMFD   SP!, {R3-R11,PC}\n"
"loc_FFC69A44:\n"
                "MOV     R1, #0\n"
                "MOV     R0, #0x85\n"
"loc_FFC69A4C:\n"
                "BL      sub_FFC6A80C\n"
                "B       loc_FFC69AB0\n"
"loc_FFC69A54:\n"
                "LDR     R12, =0x855\n"
                "CMP     R4, R12\n"
                "BEQ     loc_FFC69A90\n"
                "BGT     loc_FFC69A7C\n"
                "SUB     R12, R4, #0x800\n"
                "SUBS    R12, R12, #0x38\n"
                "SUBNE   R12, R4, #0x800\n"
                "SUBNES  R12, R12, #0x39\n"
                "BNE     loc_FFC69AA0\n"
                "B       loc_FFC69A90\n"
"loc_FFC69A7C:\n"
                "SUB     R12, R4, #0x800\n"
                "SUBS    R12, R12, #0x56\n"
                "SUBNE   R12, R4, #0x800\n"
                "SUBNES  R12, R12, #0x5D\n"
                "BNE     loc_FFC69AA0\n"
"loc_FFC69A90:\n"
                "LDR     R0, [R5,#0x10]\n"
                "LDR     R1, [R5,#0x14]\n"
                "ORRS    R0, R0, R1\n"
                "BNE     loc_FFC69AB0\n"
"loc_FFC69AA0:\n"
                "MOV     R1, R11\n"
                "MOV     R0, R4\n"
                "BL      sub_FFC69F2C_my\n"    //---------------->
                "LDMFD   SP!, {R3-R11,PC}\n"
"loc_FFC69AB0:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R3-R11,PC}\n"
 );
} 





void __attribute__((naked,noinline)) sub_FFC69570_my(){
asm volatile(
                "STMFD   SP!, {R4-R6,LR}\n"
                "MOV     R4, R0\n"
                "LDR     R0, =0x623C\n"
                "MOV     R5, R1\n"
                "LDR     R0, [R0,#0x1C]\n"
                "CMP     R0, #0\n"
                "LDRNE   R1, =0xFFC696A0\n"
                "BNE     loc_FFC6961C\n"
                "BL      sub_FFC6A2CC\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC695AC\n"
"loc_FFC6959C:\n"
                "MOV     R0, R4\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "MOV     R1, #0\n"
                "B       sub_FFC69F2C_my\n"  //--------------->
"loc_FFC695AC:\n"
                "CMP     R5, #2\n"
                "BNE     loc_FFC695C4\n"
                "BL      sub_FFC68AC0\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC6960C\n"
                "B       loc_FFC695D8\n"
"loc_FFC695C4:\n"
                "CMP     R5, #1\n"
                "BNE     loc_FFC6960C\n"
                "BL      sub_FFC68AD8\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC6960C\n"
"loc_FFC695D8:\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC73838\n"
                "SUB     R12, R4, #0x900\n"
                "SUBS    R12, R12, #0xA1\n"
                "SUBNE   R12, R4, #0x900\n"
                "SUBNES  R12, R12, #0xA3\n"
                "SUBNE   R12, R4, #0x900\n"
                "SUBNES  R12, R12, #0xA5\n"
                "LDREQ   R0, =0xC507\n"
                "MOVEQ   R1, #0\n"
                "BLEQ    sub_FFC4BB5C\n"
"loc_FFC69604:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R4-R6,PC}\n"
"loc_FFC6960C:\n"
                "BL      sub_FFC69514\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC69628\n"
                "LDR     R1, =0xFFC696B0\n"
"loc_FFC6961C:\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59F58\n"
                "B       loc_FFC69604\n"
"loc_FFC69628:\n"
                "MOV     R0, R5\n"
                "BL      sub_FFD2BE34\n"
                "B       loc_FFC6959C\n"
 );
}





void __attribute__((naked,noinline)) sub_FFC69F2C_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R8,LR}\n"
                "MOV     R7, R1\n"
                "MOV     R4, R0\n"
                "BL      sub_FFC6A348\n"
                "LDR     R5, =0x6280\n"
                "LDR     R3, =0x200A\n"
                "LDR     R12, [R5]\n"
                "LDR     R2, =0x4008\n"
                "LDR     R6, =0x9A3\n"
                "LDR     R0, =0x3007\n"
                "LDR     R1, =0x1051\n"
                "CMP     R12, #9\n"
                "ADD     LR, R3, #0x15\n"
                "ADDLS   PC, PC, R12,LSL#2\n"
                "B       loc_FFC6A284\n"
"loc_FFC69F68:\n"
                "B       loc_FFC69F90\n"
"loc_FFC69F6C:\n"
                "B       loc_FFC69FA0\n"
"loc_FFC69F70:\n"
                "B       loc_FFC69FB0\n"
"loc_FFC69F74:\n"
                "B       loc_FFC6A024\n"
"loc_FFC69F78:\n"
                "B       loc_FFC6A064\n"
"loc_FFC69F7C:\n"
                "B       loc_FFC6A0EC\n"
"loc_FFC69F80:\n"
                "B       loc_FFC6A11C\n"
"loc_FFC69F84:\n"
                "B       loc_FFC6A1CC\n"
"loc_FFC69F88:\n"
                "B       loc_FFC6A12C\n"
"loc_FFC69F8C:\n"
                "B       loc_FFC6A1F4\n"
"loc_FFC69F90:\n"
                "MOV     R1, R7\n"
                "MOV     R0, R4\n"
                "LDMFD   SP!, {R4-R8,LR}\n"
                "B       sub_FFC69EB4\n"
"loc_FFC69FA0:\n"
                "MOV     R1, R7\n"
                "MOV     R0, R4\n"
                "LDMFD   SP!, {R4-R8,LR}\n"
                "B       sub_FFC6A4C4_my\n"   //---------------->
"loc_FFC69FB0:\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FFC6A014\n"
                "SUB     R12, R4, #0x2000\n"
                "SUBS    R12, R12, #6\n"
                "BEQ     loc_FFC69FD8\n"
                "CMP     R4, R0\n"
                "BEQ     loc_FFC6A01C\n"
                "SUB     R12, R4, #0x3100\n"
                "SUBS    R12, R12, #0x4B\n"
                "BNE     loc_FFC6A284\n"
"loc_FFC69FD8:\n"
                "BL      sub_FFC694F0\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC6A330\n"
                "LDR     R0, [R5,#8]\n"
                "CMP     R0, #0\n"
                "MOVNE   R1, #0\n"
                "MOVNE   R0, R6\n"
                "BNE     loc_FFC6A00C\n"
                "LDR     R0, [R5,#4]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC6A234\n"
                "LDR     R0, =0x9A1\n"
                "MOV     R1, #0\n"
"loc_FFC6A00C:\n"
                "BL      sub_FFC69EB4\n"
                "B       loc_FFC6A234\n"
"loc_FFC6A014:\n"
                "BL      sub_FFC6A438\n"
                "B       loc_FFC6A234\n"
"loc_FFC6A01C:\n"
                "BL      sub_FFC6A450\n"
                "B       loc_FFC6A234\n"
"loc_FFC6A024:\n"
                "SUB     R12, R4, #0x900\n"
                "SUBS    R12, R12, #0xA2\n"
                "BEQ     loc_FFC6A054\n"
                "CMP     R4, R6\n"
                "BEQ     loc_FFC6A04C\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FFC6A05C\n"
                "CMP     R4, R0\n"
                "BLEQ    sub_FFC6A450\n"
                "B       loc_FFC6A284\n"
"loc_FFC6A04C:\n"
                "BL      sub_FFC69E58_my\n"  //------------->
                "B       loc_FFC6A284\n"
"loc_FFC6A054:\n"
                "BL      sub_FFC6A418\n"
                "B       loc_FFC6A284\n"
"loc_FFC6A05C:\n"
                "BL      sub_FFC6A438\n"
                "B       loc_FFC6A284\n"
"loc_FFC6A064:\n"
                "CMP     R4, LR\n"
                "BEQ     loc_FFC6A0C0\n"
                "BGT     loc_FFC6A08C\n"
                "CMP     R4, R6\n"
                "BEQ     loc_FFC6A0A8\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FFC6A0D8\n"
"loc_FFC6A080:\n"
                "CMP     R4, R3\n"
                "BNE     loc_FFC6A284\n"
                "B       loc_FFC6A09C\n"
"loc_FFC6A08C:\n"
                "CMP     R4, R0\n"
                "BEQ     loc_FFC6A0CC\n"
"loc_FFC6A094:\n"
                "CMP     R4, R2\n"
                "BNE     loc_FFC6A284\n"
"loc_FFC6A09C:\n"
                "BL      sub_FFC6A4A0\n"
                "BL      sub_FFC6A418\n"
                "B       loc_FFC6A234\n"
"loc_FFC6A0A8:\n"
                "BL      sub_FFC18898\n"
                "MOV     R0, #5\n"
                "BL      sub_FFC6A330\n"
                "MOV     R0, #0\n"
                "STR     R0, [R5,#0xC]\n"
                "B       loc_FFC6A234\n"
"loc_FFC6A0C0:\n"
                "MOV     R0, #5\n"
                "BL      sub_FFC6A330\n"
                "B       loc_FFC6A110\n"
"loc_FFC6A0CC:\n"
                "BL      sub_FFC18898\n"
                "BL      sub_FFC6A4A0\n"
                "B       loc_FFC6A1C4\n"
"loc_FFC6A0D8:\n"
                "BL      sub_FFC18898\n"
                "BL      sub_FFC6A4A0\n"
                "B       loc_FFC6A124\n"
"loc_FFC6A0E4:\n"
                "BL      sub_FFC6A330\n"
                "B       loc_FFC6A234\n"
"loc_FFC6A0EC:\n"
                "CMP     R4, LR\n"
                "BEQ     loc_FFC6A110\n"
                "BGT     loc_FFC6A104\n"
                "CMP     R4, R1\n"
                "BNE     loc_FFC6A080\n"
                "B       loc_FFC6A124\n"
"loc_FFC6A104:\n"
                "CMP     R4, R0\n"
                "BNE     loc_FFC6A094\n"
                "B       loc_FFC6A1C4\n"
"loc_FFC6A110:\n"
                "MOV     R0, R7\n"
                "BL      sub_FFC6A46C\n"
                "B       loc_FFC6A234\n"
"loc_FFC6A11C:\n"
                "CMP     R4, R1\n"
                "BNE     loc_FFC6A284\n"
"loc_FFC6A124:\n"
                "MOV     R0, #8\n"
                "B       loc_FFC6A0E4\n"
"loc_FFC6A12C:\n"
                "CMP     R4, R0\n"
                "BEQ     loc_FFC6A1C4\n"
                "BGT     loc_FFC6A1B0\n"
                "CMP     R4, R3\n"
                "BEQ     loc_FFC6A014\n"
                "CMP     R4, LR\n"
                "BEQ     loc_FFC6A110\n"
                "B       loc_FFC6A284\n"
"loc_FFC6A1B0:\n"
                "CMP     R4, R2\n"
                "SUBNE   R12, R4, #0x4000\n"
                "SUBNES  R12, R12, #0xE\n"
                "BEQ     loc_FFC6A014\n"
                "B       loc_FFC6A284\n"
"loc_FFC6A1C4:\n"
                "MOV     R0, #7\n"
                "B       loc_FFC6A0E4\n"
"loc_FFC6A1CC:\n"
                "CMP     R4, R3\n"
                "BEQ     loc_FFC6A1E4\n"
                "CMP     R4, LR\n"
                "BEQ     loc_FFC6A110\n"
                "CMP     R4, R2\n"
                "BNE     loc_FFC6A284\n"
"loc_FFC6A1E4:\n"
                "BL      sub_FFC6A418\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC69634\n"
                "B       loc_FFC6A234\n"
"loc_FFC6A1F4:\n"
                "SUB     R12, R4, #0x800\n"
                "SUBS    R12, R12, #0x4A\n"
                "BEQ     loc_FFC6A23C\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FFC6A274\n"
                "CMP     R4, R0\n"
                "BEQ     loc_FFC6A264\n"
                "SUB     R12, R4, #0x3100\n"
                "SUBS    R12, R12, #0x2A\n"
                "BNE     loc_FFC6A284\n"
                "BL      sub_FFC6A3D0\n"
                "LDR     R0, [R5,#0x14]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC6A234\n"
                "BL      sub_FFC6A3EC_my\n"  //---------------->
                "BL      sub_FFD2D0A4\n"
"loc_FFC6A234:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R4-R8,PC}\n"
"loc_FFC6A23C:\n"
                "BL      sub_FFC6A3D0\n"
                "LDR     R0, =0x8007\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC602B0\n"
                "BL      sub_FFD2BDD4\n"
                "BL      sub_FFC6A418\n"
                "BL      sub_FFD2D0A4\n"
                "BL      sub_FFC694F0\n"
                "MOV     R0, #0\n"
                "B       loc_FFC6A0E4\n"
"loc_FFC6A264:\n"
                "BL      sub_FFC6A3D0\n"
                "BL      sub_FFD2BDD4\n"
                "BL      sub_FFD2D0A4\n"
                "B       loc_FFC6A01C\n"
"loc_FFC6A274:\n"
                "BL      sub_FFC6A3D0\n"
                "BL      sub_FFD2BDD4\n"
                "BL      sub_FFD2D0A4\n"
                "B       loc_FFC6A014\n"
"loc_FFC6A284:\n"
                "MOV     R0, #1\n"
                "LDMFD   SP!, {R4-R8,PC}\n"

                ".ltorg\n"  
 );
} 





void __attribute__((naked,noinline)) sub_FFC6A4C4_my(){ 
 asm volatile(
                "LDR     R3, =0x6280\n"
                "LDR     R12, =0x2006\n"
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, [R3,#0xC]\n"
                "LDR     R2, [R3,#0x14]\n"
                "CMP     R0, R12\n"
                "BEQ     loc_FFC6A538\n"
                "BGT     loc_FFC6A504\n"
                "SUB     R12, R0, #0x900\n"
                "SUBS    R12, R12, #0xA2\n"
                "BEQ     loc_FFC6A55C\n"
                "SUB     R12, R0, #0x1000\n"
                "SUBS    R12, R12, #0x51\n"
                "BNE     loc_FFC6A580\n"
                "BL      sub_FFC6A438\n"
                "B       loc_FFC6A578\n"
"loc_FFC6A504:\n"
                "SUB     R12, R0, #0x3000\n"
                "SUBS    R12, R12, #7\n"
                "BEQ     loc_FFC6A574\n"
                "SUB     R12, R0, #0x3100\n"
                "SUBS    R12, R12, #0x4B\n"
                "BNE     loc_FFC6A580\n"
                "CMP     R2, #0\n"
                "BNE     loc_FFC6A578\n"
                "LDR     R0, [R3,#8]\n"
                "ORRS    R0, R0, R1\n"
                "BEQ     loc_FFC6A544\n"
                "BL      sub_FFC69E58_my\n"  //---------------->
                "B       loc_FFC6A578\n"
"loc_FFC6A538:\n"
                "CMP     R2, #0\n"
                "BLEQ    sub_FFC68B64\n"
                "B       loc_FFC6A578\n"
"loc_FFC6A544:\n"
                "LDR     R0, [R3,#4]\n"
                "CMP     R0, #0\n"
                "MOVNE   R0, #3\n"
                "BNE     loc_FFC6A56C\n"
                "BL      sub_FFC6A418\n"
                "B       loc_FFC6A578\n"
"loc_FFC6A55C:\n"
                "CMP     R1, #0\n"
                "BNE     loc_FFC6A578\n"
                "BL      sub_FFC1840C\n"
                "MOV     R0, #2\n"
"loc_FFC6A56C:\n"
                "BL      sub_FFC6A330\n"
                "B       loc_FFC6A578\n"
"loc_FFC6A574:\n"
                "BL      sub_FFC6A450\n"
"loc_FFC6A578:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R4,PC}\n"
"loc_FFC6A580:\n"
                "MOV     R0, #1\n"
                "LDMFD   SP!, {R4,PC}\n"
 );
} 





void __attribute__((naked,noinline)) sub_FFC69E58_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, =0xFFC6A14C\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59F58\n"
                "LDR     R4, =0x6280\n"
                "LDR     R0, [R4,#0x10]\n"
                "CMP     R0, #0\n"
                "LDMEQFD SP!, {R4,LR}\n"
                "BEQ     sub_FFC6A3EC_my\n"  //--------------->
                "LDR     R1, =0xFFC6A168\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59F58\n"
                "BL      sub_FFD2D0D0\n"
                "LDR     R0, [R4,#0x18]\n"
                "CMP     R0, #1\n"
                "MOVNE   R0, #1\n"
                "STRNE   R0, [R4,#0x18]\n"
                "BLNE    sub_FFC5F748\n"
                "MOV     R0, #9\n"
                "BL      sub_FFC6A330\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFD2BC90\n"

 );
} 





void __attribute__((naked,noinline)) sub_FFC6A3EC_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, =0xFFC6A5A0\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59F58\n"
                "LDR     R1, =0x6280\n"
                "MOV     R0, #0\n"
                "STR     R0, [R1,#0xC]\n"
                "MOV     R0, #4\n"
                "BL      sub_FFC6A330\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFC69B58_my\n"   //--------------->

 );
} 



void __attribute__((naked,noinline)) sub_FFC69B58_my(){ 
 asm volatile(
                "LDR     R0, =0x623C\n"
                "STMFD   SP!, {R3,LR}\n"
                "LDR     R1, [R0,#0x40]\n"
                "CMP     R1, #1\n"
                "MOVNE   R1, #1\n"
                "STRNE   R1, [R0,#0x40]\n"
                "BLNE    sub_FFC5F748\n"
                "MOV     R1, #0\n"
                "MOV     R0, #0x80\n"
                "BL      sub_FFC6A80C\n"
                "MOV     R2, #2\n"
                "MOV     R1, SP\n"
                "MOV     R0, #0x6B\n"
                "BL      sub_FFC5BCC0\n"
                "MOV     R2, #2\n"
                "MOV     R1, SP\n"
                "MOV     R0, #0xA3\n"
                "BL      sub_FFC5BBB8\n"
                "BL      sub_FFC4BC48\n"
                "BL      sub_FFC68DF4\n"
                "BL      sub_FFC18860_my\n"   //---------------->
                "BL      sub_FFC694A8\n"
                "LDMFD   SP!, {R12,PC}\n"
 );
} 





void __attribute__((naked,noinline)) sub_FFC18860_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "MOV     R4, R0\n"
                "MOV     R0, #0x20\n"
                "LDR     R1, =0xFFC1898C\n"
                "BL      sub_FFC59F58\n"
                "BL      sub_FFC18FD4\n"
                "CMP     R0, #0\n"
                "LDMNEFD SP!, {R4,PC}\n"
                "MOV     R0, #4\n"
                "BL      sub_FFC49530\n"
                "BL      sub_FFC4CF48\n"
                "MOV     R0, R4\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFC4F54C_my\n"  //----------->
 );
} 




void __attribute__((naked,noinline)) sub_FFC4F54C_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R8,LR}\n"
                "MOV     R8, R0\n"
                "MOV     R0, #0x41\n"
                "SUB     SP, SP, #0x38\n"
                "MOV     R5, #0\n"
                "STR     R0, [SP,#0x34]\n"
                "BL      sub_FFC4F51C\n"
                "CMP     R0, #0\n"
                "LDRNE   R1, =0x13B\n"
                "BNE     loc_FFC4F6F8\n"
                "LDR     R4, =0x56D8\n"
                "MOV     R1, #0x1E\n"
                "LDR     R0, [R4,#0xC]\n"
                "BL      sub_FFC19408\n"
                "BL      sub_FFC5BE50\n"
                "STR     R0, [R4,#4]\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC57FA0\n"
                "STR     R0, [SP,#0x28]\n"
                "ADD     R0, SP, #0x28\n"
                "MOV     R1, SP\n"
                "BL      sub_FFC580EC\n"
                "MOV     R0, SP\n"
                "BL      sub_FFC57FD4\n"
                "STR     R0, [SP,#0x2C]\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #4\n"
                "ADD     R2, SP, #0x2C\n"
                "MOV     R1, #0x34\n"
                "BL      sub_FFC5C170\n"
                "LDR     R7, [SP,#0x2C]\n"
                "BL      sub_FFC4FA74\n"
                "MOV     R6, #0\n"
                "ADD     R1, SP, #0x28\n"
                "ADD     R0, SP, #0x2C\n"
                "STR     R6, [SP,#0x2C]\n"
                "STR     R6, [SP,#0x28]\n"
                "BL      sub_FFC225AC\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x2C\n"
                "MOV     R1, #0x2F\n"
                "BL      sub_FFC5C170\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x28\n"
                "MOV     R1, #0x2D\n"
                "BL      sub_FFC5C170\n"
                "ADD     R1, SP, #0x28\n"
                "ADD     R0, SP, #0x2C\n"
                "BL      sub_FFC25D0C\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x2C\n"
                "MOV     R1, #0x30\n"
                "BL      sub_FFC5C170\n"
                "ADD     R1, SP, #0x28\n"
                "ADD     R0, SP, #0x2C\n"
                "BL      sub_FFC22D70\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x28\n"
                "MOV     R1, #0x2E\n"
                "BL      sub_FFC5C170\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x2C\n"
                "MOV     R1, #0xB8\n"
                "BL      sub_FFC5C21C\n"
                "TST     R0, #1\n"
                "LDRNE   R1, =0x11D\n"
                "LDRNE   R0, =0xFFC4F970\n"
                "BLNE    sub_FFC0C090\n"
                "LDRH    R0, [SP,#0x2C]\n"
                "MOV     R3, #4\n"
                "ADD     R2, SP, #0x28\n"
                "CMP     R0, #0\n"
                "MOVNE   R0, #1\n"
                "STR     R0, [SP,#0x28]\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R1, #0x92\n"
                "BL      sub_FFC5C170\n"
                "MOV     R2, #1\n"
                "ADD     R1, SP, #0x34\n"
                "MOV     R0, #0xFA\n"
                "BL      sub_FFC5BCC0\n"
                "TST     R0, #1\n"
                "LDRNE   R1, =0x152\n"
                "LDRNE   R0, =0xFFC4F970\n"
                "BLNE    sub_FFC0C090\n"
                "LDRB    R0, [SP,#0x34]\n"
                "MOV     R3, R8\n"
                "MOV     R2, #0x14\n"
                "AND     R1, R0, #0xFF\n"
                "ADD     R0, SP, #0x30\n"
                "STR     R7, [SP]\n"
                "BL      sub_FFCF0C24\n"
                "TST     R0, #1\n"
                "LDRNE   R1, =0x156\n"
                "BNE     loc_FFC4F6F8\n"
                "LDR     R0, =0x1986C\n"
                "LDR     R1, [SP,#0x30]\n"
                "MOV     R2, #0x10\n"
                "BL      sub_FFCE70E8\n"
                "TST     R0, #1\n"
                "BEQ     loc_FFC4F708\n"
                "LDR     R1, =0x15E\n"
"loc_FFC4F6F8:\n"
                "LDR     R0, =0xFFC4F970\n"
                "BL      sub_FFC0C090\n"
"loc_FFC4F700:\n"
                "ADD     SP, SP, #0x38\n"
                "LDMFD   SP!, {R4-R8,PC}\n"
"loc_FFC4F708:\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #4\n"
                "ADD     R2, SP, #0x30\n"
                "MOV     R1, #0x2B\n"
                "BL      sub_FFC5C170\n"
                "BL      sub_FFC6BB70\n"
                "LDRSB   R1, [SP,#0x34]\n"
                "CMP     R0, R1\n"
                "MOVEQ   R7, #0\n"
                "BEQ     loc_FFC4F75C\n"
                "LDR     R5, =0x1986C\n"
                "MOV     R0, R5\n"
                "BL      sub_FFC6BCEC\n"
                "MOV     R8, R0\n"
                "BL      sub_FFC9D4A8\n"
                "CMP     R8, R0\n"
                "MOV     R7, R0\n"
                "LDRLS   R1, =0x16B\n"
                "LDRLS   R0, =0xFFC4F970\n"
                "BLLS    sub_FFC0C090\n"
                "SUB     R7, R8, R7\n"
"loc_FFC4F75C:\n"
                "BL      sub_FFC4AF50_my\n"  //---------------->
                "LDR     R0, =0x19890\n"
                "LDRH    R3, [R0,#0x46]\n"
                "LDRH    R2, [R0,#0x44]\n"
                "LDR     R1, [R0,#0x40]\n"
                "LDR     R0, [R0,#0x3C]\n"
                "BL      sub_FFC49FD0\n"
                "MOV     R3, #0\n"
                "LDR     R2, =0xFFC4F4E4\n"
                "MOV     R1, #0\n"
                "LDR     R0, =0xFFC4F4F8\n"
                "ADD     R8, SP, #0xC\n"
                "STMIA   R8, {R0-R3}\n"
                "LDR     R2, =0xFFC4F508\n"
                "LDR     R1, =0xFFC4F4F4\n"
                "STMEA   SP, {R1-R3}\n"
                "LDR     R1, [R4,#4]\n"
                "MOV     R3, R6\n"
                "MOV     R2, R7\n"
                "MOV     R0, R5\n"
                "BL      sub_FFC4A32C\n"
                "LDR     R0, [R4,#0xC]\n"
                "MOV     R1, #0x20\n"
                "BL      sub_FFC193D4\n"
                "B       loc_FFC4F700\n"
 );
} 



void __attribute__((naked,noinline)) sub_FFC4AF50_my(){ 
 asm volatile(
                "STMFD   SP!, {R3-R9,LR}\n"
                "LDR     R5, =0x5550\n"
                "MOV     R6, #0\n"
                "STR     R6, [R5,#0x20]\n"
                "LDR     R0, [R5,#4]\n"
                "LDR     R8, =0x2710\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC4B008\n"
                "MOV     R0, #1\n"
                "STR     R0, [R5,#4]\n"
                "MOV     R0, #0\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC0BF0C\n"
                "STR     R0, [R5,#0x10]\n"
                "MOV     R0, #0\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC0BF0C\n"
                "STR     R0, [R5,#0x14]\n"
                "MOV     R0, #0\n"
                "MOV     R1, #0xA\n"
                "BL      sub_FFC0BEC4\n"
                "STR     R0, [R5,#0x18]\n"
                "MOV     R0, #0\n"
                "MOV     R1, #0xA\n"
                "BL      sub_FFC0BEC4\n"
                "LDR     R7, =0x19450\n"
                "MOV     R4, #9\n"
                "ADD     R9, R4, #0x2D4\n"
                "STR     R0, [R5,#0x1C]\n"
"loc_FFC4AFC4:\n"
                "RSB     R0, R4, R4,LSL#3\n"
                "STR     R6, [R7,R0,LSL#2]\n"
                "ADD     R1, R7, R0,LSL#2\n"
                "STR     R9, [SP]\n"
                "LDR     R0, [R5,#0x1C]\n"
                "LDR     R3, =0xFFC4A2CC\n"
                "MOV     R2, R8\n"
                "BL      sub_FFC0BFD0\n"
                "SUBS    R4, R4, #1\n"
                "BPL     loc_FFC4AFC4\n"
                "MOV     R3, #0\n"
                "STR     R3, [SP]\n"
                "LDR     R3, =MovieRecordTask_my\n"
                "MOV     R2, #0x1000\n"
                "MOV     R1, #0x14\n"
                "LDR     R0, =0xFFC4B158\n"
                "BL      sub_FFC0BE90\n"
"loc_FFC4B008:\n"
                "BL      sub_FFD125C0\n"
                "BL      sub_FFC4B06C\n"
                "MOV     R1, R0\n"
                "MOV     R0, #0xB\n"
                "ADD     R3, R0, #0x2DC\n"
                "STR     R0, [R1]\n"
                "STR     R3, [SP]\n"
                "LDR     R3, =0xFFC4A2CC\n"
                "MOV     R2, R8\n"
                "LDR     R0, [R5,#0x18]\n"
                "BL      sub_FFC0BFD0\n"
                "LDMFD   SP!, {R3-R9,PC}\n"
 );
} 


void __attribute__((naked,noinline)) MovieRecordTask_my(){ 
 asm volatile(
                "STMFD   SP!, {R2-R8,LR}\n"
                "LDR     R8, =0x32B\n"
                "LDR     R7, =0x2710\n"
                "LDR     R4, =0x5550\n"
                "MOV     R6, #0\n"
                "MOV     R5, #1\n"
"loc_FFC4AE60:\n"
                "LDR     R0, [R4,#0x18]\n"
                "MOV     R2, #0\n"
                "ADD     R1, SP, #4\n"
                "BL      sub_FFC19658\n"
                "LDR     R0, [R4,#0x20]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC4AF30\n"
                "LDR     R0, [SP,#4]\n"
                "LDR     R1, [R0]\n"
                "SUB     R1, R1, #2\n"
                "CMP     R1, #9\n"
                "ADDLS   PC, PC, R1,LSL#2\n"
                "B       loc_FFC4AF30\n"
"loc_FFC4AE94:\n"
                "B       loc_FFC4AEE4\n"
"loc_FFC4AE98:\n"
                "B       loc_FFC4AF04\n"
"loc_FFC4AE9C:\n"
                "B       loc_FFC4AF14\n"
"loc_FFC4AEA0:\n"
                "B       loc_FFC4AF1C\n"
"loc_FFC4AEA4:\n"
                "B       loc_FFC4AEEC\n"
"loc_FFC4AEA8:\n"
                "B       loc_FFC4AF24\n"
"loc_FFC4AEAC:\n"
                "B       loc_FFC4AEF4\n"
"loc_FFC4AEB0:\n"
                "B       loc_FFC4AF30\n"
"loc_FFC4AEB4:\n"
                "B       loc_FFC4AF2C\n"
"loc_FFC4AEB8:\n"
                "B       loc_FFC4AEBC\n"
"loc_FFC4AEBC:\n"
                "LDR     R0, =0xFFC4AB44\n"
                "STR     R6, [R4,#0x34]\n"
                "STR     R0, [R4,#0xA0]\n"
                "LDR     R0, =0xFFC4A5BC\n"
                "LDR     R2, =0xFFC4A4D8\n"
                "LDR     R1, =0x19578\n"
                "STR     R6, [R4,#0x24]\n"
                "BL      sub_FFC2C6CC\n"
                "STR     R5, [R4,#0x38]\n"
                "B       loc_FFC4AF30\n"
"loc_FFC4AEE4:\n"
                "BL      unlock_optical_zoom\n" //  +
                "BL      sub_FFC4AC3C\n"
                "B       loc_FFC4AF30\n"
"loc_FFC4AEEC:\n"
                "BL      sub_FFC4A944_my\n"  //------------->
                "B       loc_FFC4AF30\n"
"loc_FFC4AEF4:\n"
                "LDR     R1, [R0,#0x10]\n"
                "LDR     R0, [R0,#4]\n"
                "BL      sub_FFD131CC\n"
                "B       loc_FFC4AF30\n"
"loc_FFC4AF04:\n"
                "LDR     R0, [R4,#0x38]\n"
                "CMP     R0, #5\n"
                "STRNE   R5, [R4,#0x28]\n"
                "B       loc_FFC4AF30\n"
"loc_FFC4AF14:\n"
                "BL      sub_FFC4A74C\n"
                "B       loc_FFC4AF30\n"
"loc_FFC4AF1C:\n"
                "BL      sub_FFC4A608\n"
                "B       loc_FFC4AF30\n"
"loc_FFC4AF24:\n"
                "BL      sub_FFC4A464\n"
                "B       loc_FFC4AF30\n"
"loc_FFC4AF2C:\n"
                "BL      sub_FFC4B098\n"
"loc_FFC4AF30:\n"
                "LDR     R1, [SP,#4]\n"
                "LDR     R3, =0xFFC4A2CC\n"
                "STR     R6, [R1]\n"
                "STR     R8, [SP]\n"
                "LDR     R0, [R4,#0x1C]\n"
                "MOV     R2, R7\n"
                "BL      sub_FFC0BFD0\n"
                "B       loc_FFC4AE60\n"
 );
} 


void __attribute__((naked,noinline)) sub_FFC4A944_my(){ 
 asm volatile(                                   	
                "STMFD   SP!, {R4-R8,LR}\n"
                "SUB     SP, SP, #0x40\n"
                "MOV     R6, #0\n"
                "LDR     R5, =0x5550\n"
                "MOV     R4, R0\n"
                "STR     R6, [SP,#0x30]\n"
                "STR     R6, [SP,#0x28]\n"
                "LDR     R0, [R5,#0x38]\n"
                "MOV     R8, #4\n"
                "CMP     R0, #3\n"
                "STREQ   R8, [R5,#0x38]\n"
                "LDR     R0, [R5,#0xA0]\n"
            //  "BLX     R0\n"
                ".long   0xE12FFF30\n"
                "LDR     R0, [R5,#0x38]\n"
                "CMP     R0, #4\n"
                "BNE     loc_FFC4AA1C\n"
                "ADD     R3, SP, #0x28\n"
                "ADD     R2, SP, #0x2C\n"
                "ADD     R1, SP, #0x30\n"
                "ADD     R0, SP, #0x34\n"
                "BL      sub_FFD13360\n"
                "CMP     R0, #0\n"
                "MOV     R7, #1\n"
                "BNE     loc_FFC4A9C0\n"
                "LDR     R1, [R5,#0x28]\n"
                "CMP     R1, #1\n"
                "BNE     loc_FFC4AA24\n"
                "LDR     R1, [R5,#0x50]\n"
                "LDR     R2, [R5,#0x3C]\n"
                "CMP     R1, R2\n"
                "BCC     loc_FFC4AA24\n"
"loc_FFC4A9C0:\n"
                "CMP     R0, #0x80000001\n"
                "STREQ   R8, [R5,#0x54]\n"
                "BEQ     loc_FFC4A9F8\n"
                "CMP     R0, #0x80000003\n"
                "STREQ   R7, [R5,#0x54]\n"
                "BEQ     loc_FFC4A9F8\n"
                "CMP     R0, #0x80000005\n"
                "MOVEQ   R0, #2\n"
                "BEQ     loc_FFC4A9F4\n"
                "CMP     R0, #0x80000007\n"
                "STRNE   R6, [R5,#0x54]\n"
                "BNE     loc_FFC4A9F8\n"
                "MOV     R0, #3\n"
"loc_FFC4A9F4:\n"
                "STR     R0, [R5,#0x54]\n"
"loc_FFC4A9F8:\n"
                "LDR     R0, =0x195A8\n"
                "LDR     R0, [R0,#8]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC4AA10\n"
                "BL      sub_FFC3922C\n"
                "B       loc_FFC4AA14\n"
"loc_FFC4AA10:\n"
                "BL      sub_FFC4A464\n"
"loc_FFC4AA14:\n"
                "MOV     R0, #5\n"
                "STR     R0, [R5,#0x38]\n"
"loc_FFC4AA1C:\n"
                "ADD     SP, SP, #0x40\n"
                "LDMFD   SP!, {R4-R8,PC}\n"
"loc_FFC4AA24:\n"
                "LDR     LR, [SP,#0x30]\n"
                "CMP     LR, #0\n"
                "BEQ     loc_FFC4AAEC\n"
                "STR     R7, [R5,#0x2C]\n"
                "LDR     R0, [R5,#0x6C]\n"
                "LDR     R1, [R4,#0x14]\n"
                "LDR     R2, [R4,#0x18]\n"
                "LDR     R12, [R4,#0xC]\n"
                "ADD     R3, SP, #0x38\n"
                "ADD     R8, SP, #0x14\n"
                "STMIA   R8, {R0-R3}\n"
                "LDR     R3, [R5,#0x58]\n"
                "ADD     R2, SP, #0x3C\n"
                "ADD     R8, SP, #8\n"
           //   "LDRD    R0, [SP,#0x28]\n"
                ".long   0xE1CD02D8\n"
                "STMIA   R8, {R0,R2,R3}\n"
                "STR     R1, [SP,#4]\n"
                "STR     LR, [SP]\n"
                "LDMIB   R4, {R0,R1}\n"
                "LDR     R3, [SP,#0x34]\n"
                "MOV     R2, R12\n"
                "BL      sub_FFCD75D4\n"
                "LDR     R0, [R5,#0x10]\n"
                "MOV     R1, #0x3E8\n"
                "BL      sub_FFC0BA54\n"
                "CMP     R0, #9\n"
                "BNE     loc_FFC4AAA0\n"
                "BL      sub_FFD1393C\n"
                "MOV     R0, #0x90000\n"
                "STR     R7, [R5,#0x38]\n"
                "B       loc_FFC4AAB8\n"
"loc_FFC4AAA0:\n"
                "LDR     R0, [SP,#0x38]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC4AAC0\n"
                "BL      sub_FFD1393C\n"
                "MOV     R0, #0xA0000\n"
                "STR     R7, [R5,#0x38]\n"
"loc_FFC4AAB8:\n"
                "BL      sub_FFC5F9D4\n"
                "B       loc_FFC4AA1C\n"
"loc_FFC4AAC0:\n"
                "BL      sub_FFCD7698\n"
                "LDR     R0, [SP,#0x34]\n"
                "LDR     R1, [SP,#0x3C]\n"
                "BL      sub_FFD136E4\n"
                "LDR     R0, [R5,#0x4C]\n"
                "LDR     R1, =0x55BC\n"
                "ADD     R0, R0, #1\n"
                "STR     R0, [R5,#0x4C]\n"
                "LDR     R0, [SP,#0x3C]\n"
                "MOV     R2, #0\n"
                "BL      sub_FFD11564_my\n"     //----------------->
"loc_FFC4AAEC:\n"
                "LDR     R0, [R5,#0x50]\n"
                "ADD     R0, R0, #1\n"
                "STR     R0, [R5,#0x50]\n"
                "LDR     R1, [R5,#0x78]\n"
                "MUL     R0, R1, R0\n"
                "LDR     R1, [R5,#0x74]\n"
                "BL      sub_FFE58618\n"
                "MOV     R4, R0\n"
                "BL      sub_FFD13974\n"
                "LDR     R1, [R5,#0x70]\n"
                "CMP     R1, R4\n"
                "BNE     loc_FFC4AB28\n"
                "LDR     R0, [R5,#0x30]\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC4AB3C\n"
"loc_FFC4AB28:\n"
                "LDR     R1, [R5,#0x84]\n"
                "MOV     R0, R4\n"
            //  "BLX     R1\n"
                ".long   0xE12FFF31\n"
                "STR     R4, [R5,#0x70]\n"
                "STR     R6, [R5,#0x30]\n"
"loc_FFC4AB3C:\n"
                "STR     R6, [R5,#0x2C]\n"
                "B       loc_FFC4AA1C\n"
 );
} 


void __attribute__((naked,noinline)) sub_FFD11564_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R8,LR}\n"
                "LDR     R4, =0xA4AC\n"
                "LDR     LR, [R4]\n"
                "LDR     R2, [R4,#8]\n"
                "CMP     LR, #0\n"
                "LDRNE   R3, [R4,#0xC]\n"
                "MOV     R5, R2\n"
                "CMPNE   R3, #1\n"
                "MOVEQ   R2, #0\n"
                "STREQ   R0, [R4]\n"
                "STREQ   R2, [R4,#0xC]\n"
                "BEQ     loc_FFD11630\n"
                "LDR     R3, [R4,#4]\n"
                "LDR     R7, =table\n"             // *
                "ADD     R12, R3, R3,LSL#1\n"
                "LDR     R3, [R7,R12,LSL#2]\n"
                "ADD     R6, R7, #0x30\n"
                "LDR     R8, [R6,R12,LSL#2]\n"
                "SUB     R3, LR, R3\n"
                "CMP     R3, #0\n"
                "SUB     LR, LR, R8\n"
                "BLE     loc_FFD115EC\n"
                "ADD     R12, R7, R12,LSL#2\n"
                "LDR     LR, [R12,#4]\n"
                "CMP     LR, R3\n"
                "ADDGE   R2, R2, #1\n"
                "BGE     loc_FFD115E0\n"
                "LDR     R12, [R12,#8]\n"
                "CMP     R12, R3\n"
                "ADDLT   R2, R2, #3\n"
                "ADDGE   R2, R2, #2\n"
"loc_FFD115E0:\n"
     //         "CMP     R2, #0x17\n"   // -
     //         "MOVGE   R2, #0x16\n"   // -
                "CMP     R2, #0x1A\n"   // +
                "MOVGE   R2, #0x19\n"   // +
                "B       loc_FFD11620\n"
"loc_FFD115EC:\n"
                "CMP     LR, #0\n"
                "BGE     loc_FFD11620\n"
                "ADD     R3, R6, R12,LSL#2\n"
                "LDR     R12, [R3,#4]\n"
                "CMP     R12, LR\n"
                "SUBLE   R2, R2, #1\n"
                "BLE     loc_FFD11618\n"
                "LDR     R3, [R3,#8]\n"
                "CMP     R3, LR\n"
                "SUBGT   R2, R2, #3\n"
                "SUBLE   R2, R2, #2\n"
"loc_FFD11618:\n"
                "CMP     R2, #0\n"
                "MOVLT   R2, #0\n"
"loc_FFD11620:\n"
                "CMP     R2, R5\n"
                "STRNE   R2, [R4,#8]\n"
                "MOVNE   R2, #1\n"
                "STRNE   R2, [R4,#0xC]\n"
"loc_FFD11630:\n"
                "LDR     R2, =CompressionRateTable\n"   // *
                "LDR     R3, [R4,#8]\n"
                "LDR     R2, [R2,R3,LSL#2]\n"

                "LDR     R3, =video_mode\n"      // +
                "LDR     R3, [R3]\n"             // +
                "LDR     R3, [R3]\n"             // +
                "CMP     R3, #1\n"               // +
                "LDREQ   R3, =video_quality\n"   // +     
                "LDREQ   R3, [R3]\n"             // +     
                "LDREQ   R2, [R3]\n"             // +     

                "STR     R2, [R1]\n"
                "STR     R0, [R4]\n"
                "BL      mute_on_zoom\n"         // +
                "LDMFD   SP!, {R4-R8,PC}\n"
 );
} 

#include "conf.h"

int *video_quality = &conf.video_quality;
int *video_mode    = &conf.video_mode;

long def_table[24]={0x2000, 0x38D, 0x788, 0x5800, 0x9C5, 0x14B8, 0x10000, 0x1C6A, 0x3C45, 0x8000, 0xE35, 0x1E23,
           0x1CCD, -0x2E1, -0x579, 0x4F33, -0x7EB, -0xF0C, 0xE666, -0x170A, -0x2BC6, 0x7333, -0xB85, -0x15E3};

long table[24];

void change_video_tables(int a, int b){
 int i;
 for (i=0;i<24;i++) table[i]=(def_table[i]*a)/b; 
}

long CompressionRateTable[]={0x60, 0x5D, 0x5A, 0x57, 0x54, 0x51, 0x4D, 0x48, 0x42, 0x3B, 0x32, 0x29, 0x22, 0x1D, 0x17, 0x14, 0x10, 0xE, 0xB, 9, 7, 6, 5, 4, 3, 2, 1};
